using UnityEngine;

public class CopyWheelTransform : MonoBehaviour
{
	public Transform wheelTransform;

	public WheelCollider wheelCollider;

	public bool copyYposition;

	public bool copyXrotation;

	public bool copyYrotation;

	public bool copyAllRotation;

	private Vector3 newPosition;

	private Vector3 newAngels;

	private void Update()
	{
		if (copyYposition)
		{
			base.transform.position = wheelTransform.position;
		}
		if (copyXrotation)
		{
			base.transform.Rotate(wheelCollider.rpm / 60f * 360f * Time.deltaTime, 0f, 0f);
		}
		else if (copyYrotation)
		{
			base.transform.localRotation = Quaternion.Euler(0f, wheelCollider.steerAngle, 0f);
		}
		else if (copyAllRotation)
		{
			base.transform.Rotate(wheelCollider.rpm / 60f * 360f * Time.deltaTime, 0f, 0f);
			base.transform.localRotation = Quaternion.Euler(base.transform.localEulerAngles.x, wheelCollider.steerAngle, base.transform.localEulerAngles.z);
		}
	}
}
